package com.example.mysdktest.fanxin;

import org.junit.Test;

import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

/**
 * Created by baichuan on 2016/11/25.
 */

public class AntExecutors implements Runnable {
    public static ExecutorService pool = Executors.newFixedThreadPool(10);


    @Override
    public void run() {
        System.out.println("son wirte ant");
        System.out.println(Thread.currentThread().getId() + ",  name=" + Thread.currentThread().getName());
    }


    @Test
    public void ant1() {
        System.out.println(Thread.currentThread().getId() + ",  name=" + Thread.currentThread().getName());
        pool.execute(new AntExecutors());
        pool.execute(new AntExecutors());
        pool.execute(new AntExecutors());
        pool.execute(new AntExecutors());
        pool.execute(new AntExecutors());
    }
}
